<route lang="json5" type="page">
  {
    style: {
      navigationBarTitleText: '我的班级',
      enablePullDownRefresh : true
    },
    anonymous: false
  }
</route>

<script lang="ts" setup>
import ClassListTab from './components/ClassListTab.vue'

const tab = ref<number>(0)

// const userStore = useUserStore()

// 搜索表单
// const form = reactive<ClassApi.EnrollClassQuery>({
//   studentId: userStore.currentStudent.id,
// })

// const { reload, loadmore, records: classList, status, contentText } = usePagination(page => ClassApi.getEnrollClassPage({ ...form, ...page }))
// onReachBottom(() => {
//   console.log('onReachBottom')
//   loadmore()
// })

// onPullDownRefresh(async () => {
//   await reload()
//   uni.stopPullDownRefresh()
// })

onLoad(() => {
  // reload()
})
</script>

<template>
  <wd-tabs v-model="tab" animated sticky>
    <wd-tab title="上课中">
      <ClassListTab :status="[1]" />
    </wd-tab>
    <wd-tab title="未开课">
      <ClassListTab :status="[0]" />
    </wd-tab>
    <wd-tab title="已结课">
      <ClassListTab :status="[2]" />
    </wd-tab>
  </wd-tabs>
</template>

<style lang="scss" scoped>
  :deep(.wd-tabs__container) {
    width: 750rpx;
  }
</style>
